-
Notifications
You must be signed in to change notification settings - Fork 389
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix getting stuck after blocked state #6552
Fix getting stuck after blocked state #6552
Conversation
If this is the right solution and it ends up getitng merged, don't forget to mark the other issue as Done too :) |
e909728
to
4fbdd0d
Compare
4fbdd0d
to
7fd5d38
Compare
94b36cc
to
968f7a5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 18 of 23 files at r1, all commit messages.
Reviewable status: 18 of 23 files reviewed, 7 unresolved discussions (waiting on @mojganii)
ios/MullvadMockData/MullvadREST/RelaySelectorStub.swift
line 15 at r1 (raw file):
/// Relay selector stub that accepts a block that can be used to provide custom implementation. public final class RelaySelectorStub: RelaySelectorProtocol { var block: (RelayConstraints, UInt) throws -> SelectedRelays
How about we rename this selectRelaysResult
ios/MullvadVPN/TunnelManager/TunnelManager.swift
line 29 at r1 (raw file):
// switch self { // object.build(for theCase) // }
Let's remove these comments
ios/MullvadVPN/TunnelManager/TunnelManager.swift
line 100 at r1 (raw file):
// #else // internal var MappingOperation = MapConnectionStatusOperation.self // #endif
These too
ios/MullvadVPN/TunnelManager/TunnelManager.swift
line 940 at r1 (raw file):
// queue: internalQueue, // interactor: TunnelInteractorProxy(self), // connectionStatus: connectionStatus,
And these as well
ios/MullvadVPNTests/MullvadVPN/TunnelManager/TunnelManagerTests.swift
line 122 at r1 (raw file):
} func testExitBlockedStateAfterSatisfyingConstraints() async throws {
We can add a comment describing what the test does since the setup is quite complicated.
We could say something along the lines of
ios/MullvadVPNTests/MullvadVPN/TunnelManager/TunnelManagerTests.swift
line 181 at r1 (raw file):
await fulfillment( of: [blockedExpectation, connectedExpectation], timeout: .UnitTest.timeout
We want to make sure that the expectations are met in order here.
await fulfillment(
of: [blockedExpectation, connectedExpectation],
timeout: .UnitTest.timeout,
enforceOrder: true
)
ios/PacketTunnelCore/Actor/PacketTunnelActor.swift
line 287 at r1 (raw file):
reason: ActorReconnectReason ) async throws { defer {
We should leave this after the call to stopDefaultPathObserver
Otherwise, this will be ran here even if obfuscateConnection
throws an error (For example, invalid constraints in the relay selector) which is not a desired behaviour.
599eb5c
to
aad9489
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 16 of 23 files at r1, 5 of 5 files at r2, 2 of 2 files at r3, 1 of 1 files at r4, all commit messages.
Reviewable status: all files reviewed, 12 unresolved discussions (waiting on @mojganii)
ios/MullvadRESTTests/TransportStrategyTests.swift
line 9 at r3 (raw file):
// @testable import MullvadMockData
Intentional import?
ios/MullvadVPN/TunnelManager/MapConnectionStatusOperation.swift
line 25 at r3 (raw file):
private let logger = Logger(label: "TunnelManager.MapConnectionStatusOperation") required init(
Is this change necessary?
ios/MullvadVPN/TunnelManager/SendTunnelProviderMessageOperation.swift
line 63 at r3 (raw file):
addObserver( BackgroundObserver( application: backgroundTaskProvider,
"application" should probably be renamed to "backgroundTaskProvider".
ios/MullvadVPN/TunnelManager/TunnelInteractor.swift
line 19 at r3 (raw file):
var tunnel: (any TunnelProtocol)? { get } var application: any BackgroundTaskProvider { get }
There is this and other places in the code where "application" hasn't been renamed to the match the new type.
ios/MullvadMockData/MullvadREST/AccessMethodRepository+Stub.swift
line 12 at r4 (raw file):
import MullvadSettings public struct AccessMethodRepositoryStub: AccessMethodRepositoryDataSource {
Do we need to make all these public?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 5 of 23 files at r1, all commit messages.
Reviewable status: all files reviewed, 12 unresolved discussions (waiting on @mojganii)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 4 of 23 files at r1, 5 of 5 files at r2, 2 of 2 files at r3, 1 of 1 files at r4, all commit messages.
Reviewable status: all files reviewed, 5 unresolved discussions (waiting on @mojganii)
aad9489
to
d69d97c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 18 of 27 files reviewed, 5 unresolved discussions (waiting on @buggmagnet and @rablador)
ios/MullvadMockData/MullvadREST/RelaySelectorStub.swift
line 15 at r1 (raw file):
Previously, buggmagnet wrote…
How about we rename this
selectRelaysResult
Done.
ios/MullvadRESTTests/TransportStrategyTests.swift
line 9 at r3 (raw file):
Previously, rablador (Jon Petersson) wrote…
Intentional import?
AccessMethodRepositoryStub
was moved to MullvadMockData
.
ios/MullvadVPN/TunnelManager/MapConnectionStatusOperation.swift
line 25 at r3 (raw file):
Previously, rablador (Jon Petersson) wrote…
Is this change necessary?
Which one is drawing your attention? I didn't get the difference.
ios/MullvadVPN/TunnelManager/SendTunnelProviderMessageOperation.swift
line 63 at r3 (raw file):
Previously, rablador (Jon Petersson) wrote…
"application" should probably be renamed to "backgroundTaskProvider".
Done.
ios/MullvadVPN/TunnelManager/TunnelInteractor.swift
line 19 at r3 (raw file):
Previously, rablador (Jon Petersson) wrote…
There is this and other places in the code where "application" hasn't been renamed to the match the new type.
Done.
ios/MullvadVPN/TunnelManager/TunnelManager.swift
line 29 at r1 (raw file):
Previously, buggmagnet wrote…
Let's remove these comments
Done.
ios/MullvadVPN/TunnelManager/TunnelManager.swift
line 100 at r1 (raw file):
Previously, buggmagnet wrote…
These too
Done.
ios/MullvadVPN/TunnelManager/TunnelManager.swift
line 940 at r1 (raw file):
Previously, buggmagnet wrote…
And these as well
Done.
ios/MullvadVPNTests/MullvadVPN/TunnelManager/TunnelManagerTests.swift
line 122 at r1 (raw file):
Previously, buggmagnet wrote…
We can add a comment describing what the test does since the setup is quite complicated.
We could say something along the lines of
Done.
ios/MullvadVPNTests/MullvadVPN/TunnelManager/TunnelManagerTests.swift
line 181 at r1 (raw file):
Previously, buggmagnet wrote…
We want to make sure that the expectations are met in order here.
await fulfillment( of: [blockedExpectation, connectedExpectation], timeout: .UnitTest.timeout, enforceOrder: true )
Done.
ios/PacketTunnelCore/Actor/PacketTunnelActor.swift
line 287 at r1 (raw file):
Previously, buggmagnet wrote…
We should leave this after the call to
stopDefaultPathObserver
Otherwise, this will be ran here even ifobfuscateConnection
throws an error (For example, invalid constraints in the relay selector) which is not a desired behaviour.
Done.
ios/MullvadMockData/MullvadREST/AccessMethodRepository+Stub.swift
line 12 at r4 (raw file):
Previously, rablador (Jon Petersson) wrote…
Do we need to make all these public?
Yes, wea re using that in TunnelManagerTests
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 9 of 9 files at r5, all commit messages.
Reviewable status: all files reviewed, 5 unresolved discussions (waiting on @rablador)
d69d97c
to
85acb9e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 5 of 5 files at r6, all commit messages.
Reviewable status: all files reviewed, 5 unresolved discussions (waiting on @rablador)
🚨 End to end tests failed. Please check the failed workflow run. |
The app gets stuck in a blocked state after these transitions:
The packet tunnel is Connected, then Airplane mode is toggled.
The packet tunnel is Connected, then no relay constraints are satisfied.
This problem might also occur due to other reasons that result in a blocked state. To solve this issue, we need to refresh the tunnel status after reconnecting tunnel when the block state occurs. This pull request (PR) addresses the issue.
This change is